/*
 * PointCloud.h
 *
 *  Created on: Feb 15, 2011
 *      Author: johang
 */

#ifndef POINTCLOUD_H_
#define POINTCLOUD_H_

#include "Point.h"
#include "ContextLearnerUtils.h"

//Pcl stuff
#include "pcl/point_cloud.h"
#include "pcl/point_types.h"
#include "pcl/surface/mls.h"
#include "pcl/io/pcd_io.h"
#include <pcl/features/integral_image_normal.h>
#include <pcl/kdtree/kdtree_flann.h>

class PointCloud
{
  public:
    Point ** m_points;
    PointCloud(int width, int height);
    ~PointCloud();

    /*
     * This function fills in the normal field of each point in a PointCloud
     * First we convert to PCL and then using PCL functions we compute normals
     * */
    void
    fillNormals();
    void setValidPoints();
    void filterXYZ();

    int m_width, m_height;
    Point&
    operator()(int width, int height);
    Point
    operator()(int width, int height) const;
  private:

    float bad_point;
};

#endif /* POINTCLOUD_H_ */
